<template>
  <div>
    我是后代组件---{{ xxxnum }}
    <hr />
    <button @click="btnClick">修改高阶组件的值</button>
    <button @click="btnClick2">控制loading显示</button>
  </div>
</template>
<script>
export default {
  inject: {
    xxxnum: {
      type: 'number',
      from: 'num'
    },
    that: {
      type: Object
    },
    fn: {
      type: Function
    },
    showFn: {
      type: Function
    }
  },
  methods: {
    btnClick () {
      //   this.that.msg = '后代组件修改了高阶组件的值'
      this.fn('后代组件修改了高阶组件的值')
    },
    btnClick2 () {
      this.showFn(true)
      setTimeout(() => {
        this.showFn(false)
      }, 2000)
    }
  }
}
</script>
<style></style>
